<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta charset='utf-8' />
    <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
    <title>动态圆</title>
    <!--引入第三方的jquery脚本库-->
    <script include="jquery" src="./static/libs/include-lib-local.js"></script>
    <script src="./static/libs/include-cesium-local.js"></script>
    <!--当前示例页面样式表引用-->
    <link rel="stylesheet" href="./static/demo/cesium/style.css" />
    <script>
        'use strict';
        //定义三维视图的主要类
        var webGlobe;
        //地图初始化函数
        function init() {
            //构造三维视图类（视图容器div的id，三维视图设置参数）
            webGlobe = new Cesium.WebSceneControl('GlobeView', {
                terrainExaggeration: 1,
            });

            //构造第三方图层对象
            var thirdPartyLayer = new CesiumZondy.Layer.ThirdPartyLayer({
                viewer: webGlobe.viewer
            });
            //加载天地图
            var tdtLayer = thirdPartyLayer.appendTDTuMap({
                //天地图经纬度数据
                url: 'http://t0.tianditu.com/DataServer?T=vec_c&X={x}&Y={y}&L={l}',
                //开发token （请到天地图官网申请自己的开发token，自带token仅做功能验证随时可能失效）
                token: "9c157e9585486c02edf817d2ecbc7752",
                //地图类型 'vec'矢量 'img'影像 'ter'地形
                ptype: "vec"
            });

            //初始化视图功能管理类
            var sceneManager = new CesiumZondy.Manager.SceneManager({
                viewer: webGlobe.viewer
            });
            //显示鼠标位置控件
            sceneManager.showPosition("coordinateDiv");


            //构造实体绘制控制器对象
            var entityController = new CesiumZondy.Manager.EntityController({
                viewer: webGlobe.viewer
            });
            //添加点实体对象
            var point = entityController.appendPoint(114.06, 22.54, 0, '点', 7, webGlobe.getColor(1, 0, 0, 1), webGlobe.getColor(1, 1, 0, 1), 2);

            //开启深度检测（必须）
            webGlobe.viewer.scene.globe.depthTestAgainstTerrain = true;
            //初始化动态圆对象
            var scanEffect = new Cesium.CircleScanEffect(webGlobe.viewer, {
                center: Cesium.Cartesian3.fromDegrees(114.06, 22.54, 20),
                radius: 5000,
                scanColor: new Cesium.Color(255 / 255, 0 / 255, 0 / 255, 1),
                duration: 8000
            });

            //初始化分析功能管理类
            var analysisManager = new CesiumZondy.Manager.AnalysisManager({
                viewer: webGlobe.viewer
            });
            //添加添加场景特效-动态圆
            analysisManager.addSceneEffect(scanEffect);
            //定位跳转
            sceneManager.flyTo(114.06, 22.54, 20000, 2);
            //通过removeSceneEffect()移除场景特效
            //analysisManager.removeSceneEffect(scanEffect);
        }
    </script>
</head>

<body onload="init()">
    <div id="GlobeView"></div>
    <div id="coordinateDiv" class="coordinateClass"></div>
</body>

</html>